<?php

use hhz\constant\redis\redisKeys;
use Hhz\Redis\newCache;

class KohlerSubAction extends ActionPlugin
{
    const USER_LEVEL = self::LEVEL_NOTHING;

    public function main()
    {
        if ($this->uid) {
            //订阅
            $subKeyPrefix = 'kohler20230420-' . $this->uid;
            $redis = new newCache(redisKeys::KEY_B_CACHE_ACTIVITY_SUBSCRIBE);
            $redis->setCache(1, $subKeyPrefix);
            $expireTime = strtotime('2023-04-26') - time() + (10 * 86400);
            $redis->setExpireTime($expireTime, $subKeyPrefix);
        }
        $this->setSuccess([]);
    }

}